The principle of conservation of energy states that energy cannot be created or destroyed. In any system, the sum of the energies of the individual particles is the total energy of the system. The total energy is also called the internal energy of the system. The first law of thermodynamics is based on the conservation of energy and states that the internal energy of any isolated system (isolated from the surroundings) is conserved. More explicitly,
where Q is the heat of the system and W is the work done by the system. Heat is defined as the energy of the system that results from a difference in temperature between the system and the surroundings. The energy of the system may change form, but it must remain constant in magnitude. The internal energy of a system is a state property, depending only on the substances present and the temperature and pressure. Internal energy is also an extensive property in that an increase in the number of molecules present increases the internal energy. When a new substance is created in the system (which is no longer isolated), the energy of the system changes. Since internal energy is a state property, however, the change in energy is constant regardless of how the change is created. In fact, the change in energy from the original system depends only on the substance created.